package com.demo.bean;

public class User {
    //bean
    //添加user类的属性
    private Student stu;
    
    //默认构造函数，供Spring使用
    public User() {
    }
    
    //构造器注入
    public User(Student stu) {
        this.stu = stu;
    }
    
    //set注入
    public void setStu(Student stu) {
        this.stu = stu;
    }
    
    public Student getStu() {
        return stu;
    }

    public void getSay(){
        stu.say();
    }
    
    @Override
    public String toString() {
        return "User{" +
                "stu=" + stu +
                '}';
    }
}
